$OpenBSD: patch-configure_ac,v 1.13 2015/01/07 14:53:01 kili Exp $
--- configure.ac.orig	Sun Jan  4 23:15:57 2015
+++ configure.ac	Mon Jan  5 14:19:19 2015
@@ -590,6 +590,24 @@ AC_SUBST(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES)
 
 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
 
+AC_ARG_ENABLE(poppler-qt,
+	      AC_HELP_STRING([--disable-poppler-qt],
+			     [Don't compile poppler qt wrapper.]),
+	      enable_poppler_qt=$enableval,
+	      enable_poppler_qt="try")
+
+if test x$enable_poppler_qt = xyes; then
+  POPPLER_FIND_QT(POPPLER_QT,,)
+elif test x$enable_poppler_qt = xtry; then
+  POPPLER_FIND_QT(POPPLER_QT,
+		  [enable_poppler_qt="yes"],
+                  [enable_poppler_qt="no"])
+fi
+AC_SUBST(POPPLER_QT_CXXFLAGS)
+AC_SUBST(POPPLER_QT_LIBS)
+
+AM_CONDITIONAL(BUILD_POPPLER_QT, test "x$enable_poppler_qt" = "xyes")
+
 dnl 
 dnl Try Qt4
 dnl
@@ -622,7 +640,7 @@ AC_SUBST(POPPLER_QT4_LIBS)
 AC_SUBST(POPPLER_QT4_TEST_LIBS)
 
 if test x$enable_poppler_qt4 = xyes; then
-  AC_CHECK_TOOL(MOCQT4, moc)
+  AC_CHECK_TOOL(MOCQT4, moc4)
   AC_MSG_CHECKING([for Qt4 moc])
   mocversion=`$MOCQT4 -v 2>&1`
   mocversiongrep=`echo $mocversion | grep "Qt 4"`
@@ -907,6 +925,9 @@ glib/reference/Makefile
 glib/reference/version.xml
 glib/demo/Makefile
 test/Makefile
+poppler-qt.pc
+poppler-qt-uninstalled.pc
+qt/Makefile
 qt4/Makefile
 qt4/src/Makefile
 qt4/tests/Makefile
@@ -939,6 +960,7 @@ echo "Building poppler with support for:"
 echo "  font configuration: $with_font_configuration"
 echo "  splash output:      $enable_splash_output"
 echo "  cairo output:       $use_cairo"
+echo "  qt wrapper:         $enable_poppler_qt"
 echo "  qt4 wrapper:        $enable_poppler_qt4"
 echo "  qt5 wrapper:        $enable_poppler_qt5"
 echo "  glib wrapper:       $use_glib"
